package cn.itcast.dao;

import cn.itcast.domain.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CourierDao extends JpaRepository<Courier,Iterable> {

    @Transactional
    @Modifying
    @Query("update Courier set deltag = '1' where id=?1")
    /**
     * 作废
     */
     public void updateDeltag( Integer id);

   /*  public List<Courier> findByCourierNumOrStandardCompanyOrType(int page, int rows,Courier courier);

*/


    /*
    还原
     */

    @Transactional
    @Modifying
    @Query("update Courier  set deltag =null where id=?1")
    public void updateDeltag1( Integer ids);

}
